package cn.jia.spring7.web.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 控制器通知类，用来出来整个应用中所有的异常
 * Created by jia on 2018/4/8.
 */
@ControllerAdvice
public class APPWideExceptionHandler {
    //指定所有的空指针异常，又此方法来处理
    @ExceptionHandler(NullPointerException.class)
    public String NullPointerExceptionHandler(){
        return "error/nullPointer";
    }
}
